﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IService.Business;
using IService.DataDLL.Utility;

namespace IService
{
	public partial class Index : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (!base.IsPostBack)
			{
				this.BindData();
			}
		}

		public void BindData()
		{
            //邦定新闻列表
			DataTable table = DTVBusiness.NewsManager.GetLatestNewsListByType(3, 1);
			this.rptNewsList1.DataSource = table;
			this.rptNewsList1.DataBind();

			DataTable table2 = DTVBusiness.NewsManager.GetLatestNewsListByType(3, 2);
			this.rptNewsList2.DataSource = table2;
			this.rptNewsList2.DataBind();

            //邦定活动列表
            DataTable tableActivity = DTVBusiness.ActivityManager.GetLatestActivityList(5);
            this.rptActivityList.DataSource = tableActivity;
            this.rptActivityList.DataBind();

            //DataTable tableProducts = DTVBusiness.ProductsManager.GetLatestProductsList(5);
            //this.repProducts.DataSource = tableProducts;
            //this.repProducts.DataBind();
		}

		protected string GetShortNewsContent(string content)
		{
			return StringUtil.GetShortContent(content, 40);
		}
	}
}